(function (Cofe, Spine, $) {

    var Models = Cofe.Models;
    var File = Spine.Model.setup("File",  //Models name
            ["type", "time", "path", "length"]);  //Models attributes.

    var truncate = function (n) {
        return Math[n > 0 ? "floor" : "ceil"](n);
    }

    File.extend(Cofe.Models.Entry);

    File.include({
        init: function (data) {
            this.initCommonProps(data);
            this.length = data.length;            
            //console.log("File created:" + this.path);
        },

        sizeInK: function () {
            return truncate(this.length / 1024);
        }

    });

    if (typeof exports !== "undefined") {
        Models.File = exports;
    } else {
        Models.File = File
    }

})(Cofe, Spine, Spine.$);
